CC     = gcc
INC    = include
CFLAGS = -Wall -Werror -I$(INC)

find: find.o parser.o traverse.o predicate.o common.o action.o
	$(CC) -o $@ $^

parser.o: $(INC)/parser.c
	$(CC) $(CFLAGS) -c $<

traverse.o: $(INC)/traverse.c
	$(CC) $(CFLAGS) -c $<

predicate.o: $(INC)/predicate.c
	$(CC) $(CFLAGS) -c $<

common.o: $(INC)/common.c
	$(CC) $(CFLAGS) -c $<

action.o: $(INC)/action.c
	$(CC) $(CFLAGS) -c $<

find.o : find.c
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
	rm -f find *.o

.PHONY: clean
